package com.itheima.util;

public class AppThreadLocalUtils {
    private final  static ThreadLocal<Integer> userThreadLocal = new ThreadLocal<>();
    /**
     * 设置当前线程中的用户
     */
    public static void setUser(Integer userId){
        userThreadLocal.set(userId);
    }
    /**
     * 获取线程中的用户
     * @return
     */
    public static Integer getUserId(){
        return userThreadLocal.get();
    }
}
